<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="mydiv">打开文件的页面</div>
    <button id="openBtn">选择图片</button>
</body>

<script>
      const { dialog } = require('electron').remote
      document.querySelector('#openBtn').onclick = function () {
        dialog.showOpenDialog({
          title: '请选择你喜欢的小姐姐照片',
          defaultPath: 'xiaojiejie.jpg',
          buttonLabel: '选择图片',
          filters: [
            { name: 'jpg', extensions: ['jpg'] }
          ]
        })
      }
</script>

</script>

</html>